QT       += core gui
QT       += multimedia

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat statemachine

TARGET = DesktopTimer

TEMPLATE = app

CONFIG += c++17

CONFIG += app_bundle

RC_ICONS += resource/ico/DesktopTimer.ico

QMAKE_CXXFLAGS += -Wno-strict-aliasing -Wno-unused-variable

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0


SOURCES += \
        globalapplication.cpp \
        main.cpp \
        globalhotkey.cpp

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../view/release/ -lview
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../view/debug/ -lview

INCLUDEPATH += $$PWD/../view
DEPENDPATH += $$PWD/../view

HEADERS += \
    globalapplication.h \
    globalhotkey.h

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../module/release/ -lmodule
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../module/debug/ -lmodule

INCLUDEPATH += $$PWD/../module
DEPENDPATH += $$PWD/../module

RESOURCES += \
    resources.qrc

DISTFILES += \
    resource/sound/1111.wav \
    resource/sound/didadida.mp3 \
    translation/language_ar_sa.qm \
    translation/language_de_de.qm \
    translation/language_en_us.qm \
    translation/language_es_es.qm \
    translation/language_fr_fr.qm \
    translation/language_ko_kr.qm \
    translation/language_pt_pt.qm \
    translation/language_ru_ru.qm \
    translation/language_vi_vn.qm \
    translation/language_zh_cn.qm \
    translation/language_zh_tw.qm

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../log/release/ -llog
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../log/debug/ -llog
else:unix: LIBS += -L$$OUT_PWD/../log/ -llog

INCLUDEPATH += $$PWD/../log
DEPENDPATH += $$PWD/../log

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../components/release/ -lcomponents
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../components/debug/ -lcomponents
else:unix: LIBS += -L$$OUT_PWD/../components/ -lcomponents

INCLUDEPATH += $$PWD/../components
DEPENDPATH += $$PWD/../components

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../components/release/libcomponents.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../components/debug/libcomponents.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../components/release/components.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../components/debug/components.lib
else:unix: PRE_TARGETDEPS += $$OUT_PWD/../components/libcomponents.a

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../core/release/ -lcore
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../core/debug/ -lcore
else:unix: LIBS += -L$$OUT_PWD/../core/ -lcore

INCLUDEPATH += $$PWD/../core
DEPENDPATH += $$PWD/../core

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../module/release/ -lmodule
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../module/debug/ -lmodule
else:unix: LIBS += -L$$OUT_PWD/../module/ -lmodule

INCLUDEPATH += $$PWD/../module
DEPENDPATH += $$PWD/../module

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../service/release/ -lservice
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../service/debug/ -lservice
else:unix: LIBS += -L$$OUT_PWD/../service/ -lservice

INCLUDEPATH += $$PWD/../service
DEPENDPATH += $$PWD/../service
# Windows: link to user32 for RegisterHotKey/UnregisterHotKey
win32:win32-g++: LIBS += -luser32
win32:!win32-g++: LIBS += user32.lib
